package com.app.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.app.biz.AppCategoryBiz;
import com.app.biz.AppVersionBiz;
import com.app.dao.AppVersionDao;
import com.app.entity.AppCategory;
import com.app.entity.AppVersion;
@Service("appVersionBiz")
public class AppVersionBizImpl implements AppVersionBiz{
    
	@Autowired
	private AppVersionDao appVersionDao;
	
	public List<AppVersion> getAllAppVersions(int appId) {
		// TODO Auto-generated method stub
		return appVersionDao.getAllAppVersions(appId);
	}
	
	 public static void main(String[] args) {
			ApplicationContext context=new ClassPathXmlApplicationContext("beans.xml");
			AppVersionBiz movieBiz=(AppVersionBiz) context.getBean("appVersionBiz");
			
			List<AppVersion> list1=movieBiz.getAllAppVersions(57);
			
			for(int i=0;i<list1.size();i++){
			System.out.println(list1.get(i).getApkFileName()+":"+list1.get(i).getDataDictionary().getValueName()+":"+list1.get(i).getVersionSize());
			}
		
     }

	public int addVersion(AppVersion appVersion) {
		// TODO Auto-generated method stub
		return appVersionDao.addVersion(appVersion);
	}


	public int updateVersion(AppVersion appVersion) {
		// TODO Auto-generated method stub
		return appVersionDao.updateVersion(appVersion);
	}



	public int deleteAppVersion(int id) {
		// TODO Auto-generated method stub
		return appVersionDao.deleteAppVersion(id);
	}

    
}
